var app = getApp();

Page({
    data: {
        current: 0,
        openid: "",
        f_id: "",
        jobList:[]
    },
    onLoad: function(a) {
        var self = this,bid = a.b_id,f_id=a.f_id;
        self.setData({
           f_id:f_id
        })
        self.getJobList(bid);
    },
    closemodal: function(t) {
        this.setData({
            ScanCard:false,
            clickEnd:false
        });
    },
    // 获取订单详情
    getJobList:function(bid){
         var self = this;
          app.util.request({
            url: "entry/wxapp/UserDatelist",
            data: {
                openid: wx.getStorageSync("openid"),
                b_id: bid
            },
            success: function(a) {
                console.log(a.data.data), self.setData({
                    jobList: a.data.data
                });
            }
        });
    },
    Update: function(a) {
        var t = this;
        t.getform(a.detail.formId);
        var e = a.currentTarget.dataset.f_issj, n = a.currentTarget.dataset.f_id;
        app.util.request({
            url: "entry/wxapp/Jianzhi_update",
            data: {
                f_id: n,
                status: e
            },
            success: function() {
                t.getShangjiajianzhi(t.data.current);
            }
        });
    },
    Del: function(a) {
        var t = this;
        t.getform(a.detail.formId);
        var e = a.currentTarget.dataset.f_id;
        app.util.request({
            url: "entry/wxapp/Jianzhi_del",
            data: {
                f_id: e
            },
            success: function() {
                t.getShangjiajianzhi(t.data.current);
            }
        });
    },
    qzhi: function(a) {
        var t = this;
        t.getform(a.detail.formId);
        var e = a.currentTarget.dataset.f_id;
        app.util.request({
            url: "entry/wxapp/Jianzhi_qzhi",
            data: {
                f_id: e
            },
            success: function() {
                t.getShangjiajianzhi(t.data.current);
            }
        });
    },
    getform: function(a) {
        console.log(a), app.util.request({
            url: "entry/wxapp/Formid",
            data: {
                openid: wx.getStorageSync("openid"),
                formid: a
            },
            success: function(a) {}
        });
    },
    jobDetailClick: function(a) {
        var self = this;
        this.getform(a.detail.formId);
        wx.navigateTo({
            url: "/hyb_jianzhi/job_detail/job_detail?j_id="+self.data.f_id
        });
    },
    onShow: function() {
    },
    onShareAppMessage: function() {}
});